package com.sn.author.common.enums;

import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

/**
 * @Author xiaom
 * @Date 2020/9/17 16:32
 * @Version 1.0.0
 * @Description <>
 **/
public enum UploadTypeEnum {
    ACCOUNT_TYPE(10,"账户"),
    VIDEO_TYPE(20,"视频类型"),
    DY_ACCOUNT_TYPE(30,"抖音账号");

    @Getter
    private final Integer type;

    @Getter
    private final String desc;

    UploadTypeEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static Optional<UploadTypeEnum> match(Integer type) {
        return Arrays.stream(UploadTypeEnum.values())
                .filter(t -> t.getType().equals(type))
                .findFirst();
    }
}
